<!-- php:$title = '订单（'.$rs.sn.'）评论_我的订单_会员中心' -->
<!-- include tpl=header title=$title -->
<script type="text/javascript">
function save_comment(tid)
{
	var url = api_url('comment','save','tid='+tid+"&order_id={$rs.id}&vtype=order");
	var comment = $("#comment_"+tid).val();
	if(!comment){
		$.dialog.alert('评论内容不能为空',function(){},'error');
		return false;
	}
	url += '&comment='+$.str.encode(comment);
	$.phpok.json(url,function(rs){
		if(!rs.status){
			$.dialog.alert(rs.info);
			return false;
		}
		$.dialog.tips('评论提交成功',function(){
			$("#comment_"+tid).val('');
		}).lock();
	});
	return false;
}
</script>
<section class="container"><div class="mt-3"><!-- include tpl=block/breadcrumb --></div></section>
<section class="container">
	<div class="row">
		<div class="col-sm-3">
			<!-- include tpl=block/usercp_nav -->
		</div>
		<div class="col-sm-9">
		
			<!-- loop from=$rslist key=$key value=$value id=$tmpid -->
			<div class="card{if $tmpid.index} mt-3{/if}">
				<div class="card-header">
					评论产品：{$value.title}
				</div>	
				<table class="table">
				<thead>
				<tr>
					<th>图片</th>
					<th>基本信息</th>
					<th>购买数量</th>
					<th>价格</th>
				</tr>
				</thead>
				<tbody>		
				<tr>
					<td align="center">
						<!-- if $value.thumb && file_exists($value.thumb) -->
						<img src="{$value.thumb}" width="80" height="80" border="0" />
						<!-- else -->
						<img src="{#images#}/blank.gif" width="80" height="80" border="0" />
						<!-- /if -->
					</td>
					<td>
						<!-- loop from=$value.ext key=$k value=$v id=$tmpid -->
						<div>{$v.title}：{$v.content}</div>
						<!-- /loop -->
						<div>售价：{func price_format $value.price $rs.currency_id $rs.currency_id}</div>
					</td>
					<td class="center">{$value.qty}</td>
					<td class="center price">{func price_format $value.price*$value.qty $rs.currency_id $rs.currency_id}</td>
				</tr>
					<!-- loop from=$value.comment key=$k value=$v id=$tmpid2 -->
					<tr>
						<td align="center">评论#{$tmpid2.num}<br />{func time_format $v.addtime}</td>
						<td colspan="3">
							<div class="content">{$v.content}</div>
							<!-- if $v.adm_reply -->
							<div class="adm_reply"><div class="adminer">管理员回复：</div>{$v.adm_reply}</div>
							<!-- /if -->
						</td>
					</tr>
					<!-- /loop -->
					<tr>
						<form method="post" onsubmit="return save_comment('{$value.tid}')">
						<td align="center">发表评论</td>
						<td colspan="2">
							<textarea name="comment" id="comment_{$value.tid}" class="form-control"></textarea>
						</td>
						<td align="center"><input type="submit" value="提交评论" class="btn btn-primary" /></td>
						</form>
					</tr>
				</tbody>
				</table>
			</div>
			<!-- /loop -->
		</div>
	</div>
</section>
<!-- include tpl=footer -->